<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ include file="/wesite/view/common/base.jsp" %>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>专题商品</title>
    <%@ include file="/wesite/view/common/common.jsp" %>
    <style type="text/css">
        html, body {
            background: #fff;
        }
        .content ul li span.guige{
            color: #666;
            font-size: 0.64rem;
        }
    </style>
</head>

<body>

<div class="homepage">
    <%@ include file="/wesite/view/common/top.jsp" %>
    <div class="h98"></div>
    <c:if test="${not empty channel.photo}"><div class="subject img"><a href="javascript:showlmurl('${channel.url}');"><img src="<%=getRandomFileserver()%>${channel.photo}"></a></div></c:if>
    <div class="tab-ct-item" style="display:block"  >
        <c:forEach items="${channel.sublist }" var="info">
            <c:if test="${not empty info.photo}">
                <div class="special-ad inner mt-20"><a href="javascript:showlmurl('${info.url}');"><img
                        src="<%=getRandomFileserver()%>${info.photo}" style="max-width:1210px;"/></a></div>
            </c:if>
            <div class="homepage-timer product-box">
                    <div class="content">
                        <ul>
                            <c:forEach items="${info.products }" var="product">

                                <li pid="${product.id }" onclick="javascript:window.location='${ctx }/we/product/${product.id}';">
                                    <img src="<%=getRandomFileserver()%>${product.photo}" onerror="this.src='${ctx }/website/images/noimg.jpg'">
                                    <h3>${product.productname } ${product.name }</h3>
                                    <span class="company">
                                        <c:choose>
                                            <c:when test="${fn:length(product.B_chanjia) > 11}">
                                                <c:out value="${fn:substring(product.B_chanjia, 0, 11)}..."/>
                                            </c:when>
                                            <c:otherwise>
                                                <c:out value="${product.B_chanjia}"/>
                                            </c:otherwise>
                                        </c:choose>
                                    </span>
                                    <span class="specifications">${product.B_guige }</span>
                                    <span class="price">
                                        <p>
                                            <i class="a">
                                                <c:choose>
                                                    <c:when
                                                        test="${islogin && isuserauth }">
                                                        <c:if test="${product.canbuy != 1}">
                                                            <span>不在本区域销售</span>
                                                        </c:if>
                                                        <c:if test="${product.canbuy == 1}">
                                                            <span>¥${product.price }</span>
                                                            <c:if test="${product.promotion_coupon eq 'true'}">
                                                                <em>券</em>
                                                            </c:if>
                                                            <c:if test="${product.promotion_money_off eq 'true'}">
                                                                <em>满减</em>
                                                            </c:if>
                                                            <c:if test="${product.promotion_purchase_gift eq 'true'}">
                                                                <em>满赠</em>
                                                            </c:if>
                                                            <c:if test="${product.promotion_buy_send eq 'true'}">
                                                                <em>买送</em>
                                                            </c:if>
                                                            <c:if test="${product.promotion_flash_sale eq 'true'}">
                                                                <em>特价</em>
                                                            </c:if>
                                                        </c:if>

                                                    </c:when>
                                                    <c:when test="${!islogin}">
                                                        登录可见
                                                    </c:when>
                                                    <c:when
                                                     test="${!isuserauth}">审核通过可见
                                                    </c:when>
                                                </c:choose>
                                            </i>
                                        </p>
                                    </span>
                                    <c:choose>
                                        <c:when test="${product.canbuy != 1 || product.amount < 1 || !(islogin && isuserauth)}">
                                            <a  class="ico-shopping-cart" href="javascript:;"><img src="${ctx}/wesite/images/ico-shopping-cart-no.png" ></a>
                                        </c:when>
                                        <c:otherwise>
                                            <a onclick="stopBubble(event,${product.id })" class="ico-shopping-cart" href="javascript:;"><img src="${ctx}/wesite/images/ico-shopping-cart.png" ></a>
                                        </c:otherwise>
                                    </c:choose>

                                </li>


                            </c:forEach>
                        </ul>
                    </div>

            </div>
        </c:forEach>
    </div>
</div>
</div>

<%@ include file="/wesite/view/common/popup-menu.jsp"%>

<%--<%@ include file="/wesite/view/common/bottom.jsp"%>--%>

<script>
    function showlmurl(url){
        if(url)window.open(url)

    }

</script>
</body>
</html>

